package com.vrv.netmgr.alarm.detail;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.view.WindowManager;
import android.widget.ImageButton;
import android.widget.TextView;

import com.vrv.common.GlobalConstants;
import com.vrv.netmgr.R;
import com.vrv.netmgr.vo.HardwareChange;
import com.vrv.netmgr.vo.PmoveableDiskEvent;

/**
 * @Description 注册资产查询策略详细信息
 * @author yangzijian
 * @date
 *
 */
public class DetailIllegalSoftProcessActivity extends Activity {
    private static final String TAG = DetailIllegalSoftProcessActivity.class.getSimpleName();
    private static final boolean DEBUG = true && GlobalConstants.DEBUG;
    //
    private PmoveableDiskEvent info;
    public void onCreate(Bundle savedInstanceState){
        if(DEBUG) Log.v(TAG, "onCreate()");
        
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
        setContentView(R.layout.detail_illegalsoftprocess);
        getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.common_title);
        getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
        //
        initViews();
        setTitle();
    }
    //
    public void initViews(){
        if(DEBUG) Log.v(TAG, "initViews()");
        //
        TextView istps_deptName = (TextView) findViewById(R.id.istps_deptName);
        TextView istps_officeName = (TextView) findViewById(R.id.istps_officeName);
        TextView istps_userName = (TextView) findViewById(R.id.istps_userName);
        TextView istps_tel = (TextView) findViewById(R.id.istps_tel);
        TextView istps_ipaddress = (TextView) findViewById(R.id.istps_ipaddress);
        TextView istps_auditTypeName = (TextView) findViewById(R.id.istps_auditTypeName);
        TextView istps_description = (TextView) findViewById(R.id.istps_description);
        TextView istps_policyName = (TextView) findViewById(R.id.istps_policyName);
        TextView istps_authUserName = (TextView) findViewById(R.id.istps_authUserName);
        TextView istps_upTime = (TextView) findViewById(R.id.istps_upTime);
        TextView istps_clientTime = (TextView) findViewById(R.id.istps_clientTime);
        TextView istps_macAddress = (TextView) findViewById(R.id.istps_macAddress);
        //
        info = (PmoveableDiskEvent) getIntent().getSerializableExtra("info");
        //
        istps_deptName.setText(info.getIstps_deptName());
        istps_officeName.setText(info.getIstps_officeName());
        istps_userName.setText(info.getIstps_userName());
        istps_tel.setText(info.getIstps_tel());
        istps_ipaddress.setText(info.getIstps_ipaddress());
        istps_auditTypeName.setText(info.getIstps_auditTypeName());
        istps_description.setText(info.getIstps_description());
        istps_policyName.setText(info.getIstps_policyName());
        istps_authUserName.setText(info.getIstps_authUserName());
        istps_upTime.setText(info.getIstps_upTime());
        istps_clientTime.setText(info.getIstps_clientTime());
        istps_macAddress.setText(info.getIstps_macAddress());
    }
    public void setTitle() {
        if(DEBUG) Log.v(TAG, "setTitle()");
        
        TextView title = (TextView) findViewById(R.id.title_text);
        title.setText("违规软件及进程"+"["+info.getIstps_ipaddress()+"]");

        /**
         * 返回按钮
         */
        ImageButton backBtn = (ImageButton) findViewById(R.id.backBtn);
        backBtn.setVisibility(View.VISIBLE);
        backBtn.setOnClickListener(new OnClickListener() {

            @Override
            public void onClick(View v) {
                onBackPressed();
            }
        });
    }
    @Override
    public void onBackPressed() {
        if(DEBUG) Log.v(TAG, "onBackPressed()");
        
        finish();
        overridePendingTransition(R.anim.push_right_out, R.anim.push_right_in);
        super.onBackPressed();
    }
}
